// ==UserScript==
// @name           Yahoo Baseball Add Date Links
// @namespace      http://glenncarr.com/greasemonkey/fantasybaseball
// @include        *baseball.fantasysports.yahoo.com/*
// $LastChangedRevision: 82 $
// $LastChangedDate: 2007-05-29 16:18:50 +0000 (Tue, 29 May 2007) $
// ==/UserScript==
/*
   Updates:
   29-May-2007 - Changed include path to allow http://beta.
*/

(function() {

var divDateNav = document.getElementById( 'datenav' );
if ( divDateNav == null )
    return;

var className = getClassName( divDateNav );
if ( !/^rosternav navlist/i.test( className ) )
    return;

var lis = divDateNav.getElementsByTagName( 'LI' );
if ( lis == 0 )
    return;

var links = divDateNav.getElementsByTagName( 'A' );
if ( links == 0 )
    return;

var liLastDate = lis[ lis.length - 1 ];
var lastDate = stripTags( liLastDate.innerHTML );
//alert( lastDate );
//var d = Date.parse( lastDate );
//alert( d );

for ( var i = 0; i < 5; i++ )
{
    var li = document.createElement( 'li' );
    li.setAttribute( 'class', 'future' );
    li.innerHTML = '<a href="">test</a>';
    lis[ 0 ].parentNode.appendChild( li );
}

function getClassName( el )
{
    var className = el.getAttribute( 'class' );
    if ( className == null )
        className = el.getAttribute( 'className' );
    return className;
}

function stripTags(s)
{
    return s.replace(/<\/?[^>]+>|&nbsp;/gi,'');
}

})();